#include<vector>
#include<iostream>
using namespace std;


class Solution {
public:
    vector<int> twoSum(vector<int>& numbers, int target) {
        int len = numbers.size();
        for (int i = 0; i < len; i++) {
            for (int j = i + 1; j < len; j++) {
                if (numbers[i] + numbers[i + 1] > target || (numbers[i] + numbers[len - 1] < target)) {
                    break;
                }
                if (numbers[i] + numbers[j] == target) {
                    return vector<int>({ i + 1, j + 1 });
                }
            }
        }
        return {};
    }
};